The present invention relates to correcting for corrupted data in a digital image caused by defective pixels in an image sensor.
In certain types of image sensors, when there is a defect in two pixels of such sensor it causes two adjacent lines of pixels in a digital image to have corrupt data. This happens during the transfer of electrons corresponding to pixels when such electrons are transferred through the defective pixel. An example of this situation is a full frame image sensor. In a typical full frame image sensor after an image is captured, electrons stored in the pixels of such sensor are transferred a line at a time through the pixels of the image sensor. A defective pixel will corrupt data stored in the electrons of subsequent pixels which pass throught it. This causes a line of corrupted pixel data. In a full frame image sensor, a column defect is an anomaly in the structure of an image sensor that prevents the vertical transfer of pixel charge packets. As a consequence, none of the affected pixels in the adjacent columns of defective pixels can provide valid image information. If left untreated, this condition would produce a partial height or a full height adjacent vertical lines of artifacts running through the image. The current method of concealing a column defect is to average nearest horizontal neighbors of the same filter type. In a standard color filter array (CFA), for example, the Bayer CFA pattern shown in commonly-assigned U.S. Pat. No. 3,971,065, that means averaging the pixel two positions to the left with the pixel two positions to the right. While this method works well enough for the vast majority of pixels, it fails to properly handle corrupted pixels in certain image contexts, such as high contrast diagonal edges. In addition, when the current method fails, it doesn""t fail gracefully, but rather with opposing vertical spikes of spurious color.
It is an object of the present invention to provide an improved method for correcting for two adjacent lines of corrupted data in a digital image formed by an image sensor with defective pixels.
It is another object of the present invention to provide a method which is particularly suited for correcting for adjacent column defects in a full frame image sensor and that works effectively for a variety of scene content including high contrast diagonal edges.
These objects are achieved in a method for correcting for defects in a digital image taken by an image sensor when there are pre-existing defects in two pixels in adjacent columns of the image sensor which causes two adjacent lines of pixels in the digital image to have corrupted data, comprising the steps of:
(a) providing a defect map which identifies the position of the defective pixels and specifies the two adjacent lines of pixels which during readout will be caused to have corrupted data;
(b) capturing the digital image in the image sensor and reading out such digital image to provide the digital image with the two adjacent lines of pixels in the digital image having corrupted data;
(c) computing classifiers based on adjacent non-corrupted pixel data which indicate that there is a horizontal edge or a diagonal edge feature which passes through the defective lines of pixels; and
(d) adaptively replacing the data in the corrupted image pixels by selecting an algorithm which correponds to the edge feature identified by the classifier and using the valid data in the neighboring non-corrupted pixels of the selected edge feature.
It is an advantage of the present invention to provide a concealment algorithm for correcting for corruption in two adjacent lines of pixel data caused by defective pixels in an image sensor such as a full frame image sensor. This algorithm significantly improves the efficacy of correcting for a line of corrupted pixel data over a wide range of scene content.